<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="se.hh.lab.domain.*" import="se.hh.lab.dao.*" import="se.hh.lab.dao.impl.*" %>
  <%@ include file="user_sidebar.jsp" %>
  <%@ include file="user_pagehead.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <base href="<%=basePath%>">
	<title> Lab in Halmstad University</title>
  </head>
  
  <body>
<%
@SuppressWarnings("unchecked")
ArrayList<Instruments> list=(ArrayList<Instruments>)session.getAttribute("list");
if(list==null)
{	
	response.sendRedirect("user_main.jsp");
	return;
}
int row=list.size();
int intPage=(Integer)request.getAttribute("intPage");
int pageadd=intPage+1;
int pagesub=intPage-1;
String name=(String)request.getAttribute("name");
String type=(String)request.getAttribute("type");
String barcode=(String)request.getAttribute("barcode");


//	System.out.println(row);


 %>
  <div id="body-wrapper">
  <div id="main-content">
    <div class="clear"></div>
    <div class="content-box">

      <div class="content-box-header">
        <h3>List Instruments</h3>
        <ul class="content-box-tabs">
          <li><a href="#tab1" class="default-tab">Table</a></li> </ul>
        <div class="clear"></div>
      </div>
            <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
         
          <table>
            <thead>
              <tr>
                <th>Barcode</th>
                <th>Instruments name</th>
            	<th>State</th>            
                <th>productive time</th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="6">
                  <div class="pagination">
                  <a href="QueryAdvancedInstruments?page=<%=pagesub %>&name=<%=name %>&barcode=<%=barcode %>&type=<%=type %>">&laquo;Previous</a>
 				  <a href="QueryAdvancedInstruments?page=<%=pageadd %>&name=<%=name %>&barcode=<%=barcode %>&type=<%=type %>">Next &raquo;</a>
   				  </div>
                  <div class="clear"></div>
                </td>
              </tr>
            </tfoot>
            <tbody>
            <%for(int i=0;i<row;i++){	%>
              <tr>
                <td><%=list.get(i).getBarcode() %></td>
                <td><%=list.get(i).getName() %></td>
                <td><%=list.get(i).getType() %></td>
                <td><%=list.get(i).getDate() %></td>
              </tr>
              <%} %>
             
            </tbody>
          </table>

        </div>
        <!-- End #tab1 -->   
      </div>
    </div>
    
      </div>
  <!-- End #main-content -->
</div>
  </body>
  
  
  
  </html>